home *** CD-ROM | disk | FTP | other *** search
/ Clickx 47 / Clickx 47.iso / assets / software / Miro_Installer.exe / xulrunner / chrome / toolkit.jar / content / global / netError.xhtml < prev    next >
Encoding:
Extensible Markup Language  |  2005-10-03  |  9.2 KB  |  218 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!DOCTYPE html [
  4.   <!ENTITY % htmlDTD
  5.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  6.     "DTD/xhtml1-strict.dtd">
  7.   %htmlDTD;
  8.   <!ENTITY % netErrorDTD
  9.     SYSTEM "chrome://global/locale/netError.dtd">
  10.   %netErrorDTD;
  11.   <!ENTITY % globalDTD
  12.     SYSTEM "chrome://global/locale/global.dtd">
  13.   %globalDTD;
  14. ]>
  15.  
  16. <!-- ***** BEGIN LICENSE BLOCK *****
  17.    - Version: MPL 1.1/GPL 2.0/LGPL 2.1
  18.    -
  19.    - The contents of this file are subject to the Mozilla Public License Version
  20.    - 1.1 (the "License"); you may not use this file except in compliance with
  21.    - the License. You may obtain a copy of the License at
  22.    - http://www.mozilla.org/MPL/
  23.    -
  24.    - Software distributed under the License is distributed on an "AS IS" basis,
  25.    - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  26.    - for the specific language governing rights and limitations under the
  27.    - License.
  28.    -
  29.    - The Original Code is mozilla.org code.
  30.    -
  31.    - The Initial Developer of the Original Code is
  32.    - Netscape Communications Corporation.
  33.    - Portions created by the Initial Developer are Copyright (C) 1998
  34.    - the Initial Developer. All Rights Reserved.
  35.    -
  36.    - Contributor(s):
  37.    -   Adam Lock <adamlock@netscape.com>
  38.    -   William R. Price <wrprice@alumni.rice.edu>
  39.    -   Henrik Skupin <mozilla@hskupin.info>
  40.    -   Jeff Walden <jwalden+code@mit.edu>
  41.    -
  42.    - Alternatively, the contents of this file may be used under the terms of
  43.    - either the GNU General Public License Version 2 or later (the "GPL"), or
  44.    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  45.    - in which case the provisions of the GPL or the LGPL are applicable instead
  46.    - of those above. If you wish to allow use of your version of this file only
  47.    - under the terms of either the GPL or the LGPL, and not to allow others to
  48.    - use your version of this file under the terms of the MPL, indicate your
  49.    - decision by deleting the provisions above and replace them with the notice
  50.    - and other provisions required by the LGPL or the GPL. If you do not delete
  51.    - the provisions above, a recipient may use your version of this file under
  52.    - the terms of any one of the MPL, the GPL or the LGPL.
  53.    -
  54.    - ***** END LICENSE BLOCK ***** -->
  55.  
  56. <html xmlns="http://www.w3.org/1999/xhtml">
  57.   <head>
  58.     <title>&loadError.label;</title>
  59.     <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
  60.     <!-- XXX this needs to be themeable -->
  61.     <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAANbY1E9YMgAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAICSURBVHjaYvz//z8DJQAggJhwiDPvnmlzc2aR0O+JGezt+AwACCCsBhxfYhn59N41FWtXIxZOLu70niRGXVwGAAQQNgNYHj96O8HaWYdJW5ubwd4/mI2Ng7sblwEAAYRhwMm1URk/vn4SUNWVYGD8+YZBXZOZm5OLzRjoCmNsBgAEEKoBN82Y7l851GLrqMjM8Oc7A8O/3wwMP54wuAQFCXNycUzGZgBAAKEYcOaKZO2/f//5FbUVgBrfMoRVcgHpNwyKGjKMXDwCan0prFboBgAEELIBzDcvXyy2cVZhYPj9GWj7H4jo/38MDJ9OMDj7O/KzsjH3oxsAEEBwA/bNNipiZf7FI6cqwcDw8x2qqp8fGORUpVn4BEXlgGHhhCwFEEAwA9gfP3hdZ+Oizcjw+wvCdjgAuuLrFQbXIH9hTm7uqcgyAAEENuD4ctcebm5mbikFYRTbV7V/Q6j88Z5BSuY7q4CQgAjQFR4wYYAAAhtw89L5ZFsnRaDtn4CW/YXrAQcisit+PGVwDgrnZ2NnnwATBQggpsNLvGYLCAmxi8tLARWg+h3FBVBXSEj/ZZWQkRcCuiIQJAQQQCyvnj5KMDTkZ2JgYmRg4FchnHv+vmEwttLmeXT3VjKQtx4ggFgk5TXebV63UfT3ijOMxOZAVlZWdiB1EMQGCCBGSrMzQIABAFR3kRM3KggZAAAAAElFTkSuQmCC" />
  62.  
  63.     <script type="application/x-javascript"><![CDATA[
  64.       // Error url MUST be formatted like this:
  65.       //   moz-neterror:page?e=error&u=url&d=desc
  66.  
  67.       // Note that this file uses document.documentURI to get
  68.       // the URL (with the format from above). This is because
  69.       // document.location.href gets the current URI off the docshell,
  70.       // which is the URL displayed in the location bar, i.e.
  71.       // the URI that the user attempted to load.
  72.  
  73.       function getErrorCode()
  74.       {
  75.         var url = document.documentURI;
  76.         var error = url.search(/e\=/);
  77.         var duffUrl = url.search(/\&u\=/);
  78.         return decodeURIComponent(url.slice(error + 2, duffUrl));
  79.       }
  80.  
  81.       function getDescription()
  82.       {
  83.         var url = document.documentURI;
  84.         var desc = url.search(/d\=/);
  85.  
  86.         // desc == -1 if not found; if so, return an empty string
  87.         // instead of what would turn out to be portions of the URI
  88.         if (desc == -1) return "";
  89.  
  90.         return decodeURIComponent(url.slice(desc + 2));
  91.       }
  92.  
  93.       function retryThis()
  94.       {
  95.         // Session history has the URL of the page that failed
  96.         // to load, not the one of the error page. So, just call
  97.         // reload(), which will also repost POST data correctly.
  98.         location.reload();
  99.       }
  100.  
  101.       function initPage()
  102.       {
  103.         var err = getErrorCode();
  104.  
  105.         // if it's an unknown error or there's no title or description
  106.         // defined, get the generic message
  107.         var errTitle = document.getElementById("et_" + err);
  108.         var errDesc  = document.getElementById("ed_" + err);
  109.         if (!errTitle || !errDesc)
  110.         {
  111.           errTitle = document.getElementById("et_generic");
  112.           errDesc  = document.getElementById("ed_generic");
  113.         }
  114.  
  115.         var title = document.getElementById("errorTitleText");
  116.         if (title)
  117.         {
  118.           title.parentNode.replaceChild(errTitle, title);
  119.           // change id to the replaced child's id so styling works
  120.           errTitle.id = "errorTitleText";
  121.         }
  122.  
  123.         var sd = document.getElementById("errorShortDescText");
  124.         if (sd)
  125.           sd.textContent = getDescription();
  126.  
  127.         var ld = document.getElementById("errorLongDesc");
  128.         if (ld)
  129.         {
  130.           ld.parentNode.replaceChild(errDesc, ld);
  131.           // change id to the replaced child's id so styling works
  132.           errDesc.id = "errorLongDesc";
  133.         }
  134.  
  135.         // remove undisplayed errors to avoid bug 39098
  136.         var errContainer = document.getElementById("errorContainer");
  137.         errContainer.parentNode.removeChild(errContainer);
  138.       }
  139.     ]]></script>
  140.   </head>
  141.  
  142.   <body dir="&locale.dir;">
  143.  
  144.     <!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
  145.     <div id="errorContainer">
  146.       <div id="errorTitlesContainer">
  147.         <h1 id="et_generic">&generic.title;</h1>
  148.         <h1 id="et_dnsNotFound">&dnsNotFound.title;</h1>
  149.         <h1 id="et_fileNotFound">&fileNotFound.title;</h1>
  150.         <h1 id="et_malformedURI">&malformedURI.title;</h1>
  151.         <h1 id="et_protocolNotFound">&protocolNotFound.title;</h1>
  152.         <h1 id="et_connectionFailure">&connectionFailure.title;</h1>
  153.         <h1 id="et_netTimeout">&netTimeout.title;</h1>
  154.         <h1 id="et_redirectLoop">&redirectLoop.title;</h1>
  155.         <h1 id="et_unknownSocketType">&unknownSocketType.title;</h1>
  156.         <h1 id="et_netReset">&netReset.title;</h1>
  157.         <h1 id="et_netOffline">&netOffline.title;</h1>
  158.         <h1 id="et_netInterrupt">&netInterrupt.title;</h1>
  159.         <h1 id="et_deniedPortAccess">&deniedPortAccess.title;</h1>
  160.         <h1 id="et_proxyResolveFailure">&proxyResolveFailure.title;</h1>
  161.         <h1 id="et_proxyConnectFailure">&proxyConnectFailure.title;</h1>
  162.       </div>
  163.       <div id="errorDescriptionsContainer">
  164.         <div id="ed_generic">&generic.longDesc;</div>
  165.         <div id="ed_dnsNotFound">&dnsNotFound.longDesc;</div>
  166.         <div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
  167.         <div id="ed_malformedURI">&malformedURI.longDesc;</div>
  168.         <div id="ed_protocolNotFound">&protocolNotFound.longDesc;</div>
  169.         <div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
  170.         <div id="ed_netTimeout">&netTimeout.longDesc;</div>
  171.         <div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
  172.         <div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
  173.         <div id="ed_netReset">&netReset.longDesc;</div>
  174.         <div id="ed_netOffline">&netOffline.longDesc;</div>
  175.         <div id="ed_netInterrupt">&netInterrupt.longDesc;</div>
  176.         <div id="ed_deniedPortAccess">&deniedPortAccess.longDesc;</div>
  177.         <div id="ed_proxyResolveFailure">&proxyResolveFailure.longDesc;</div>
  178.         <div id="ed_proxyConnectFailure">&proxyConnectFailure.longDesc;</div>
  179.       </div>
  180.     </div>
  181.  
  182.     <!-- PAGE CONTAINER (for styling purposes only) -->
  183.     <div id="errorPageContainer">
  184.     
  185.       <!-- Error Title -->
  186.       <div id="errorTitle">
  187.         <h1 id="errorTitleText" />
  188.       </div>
  189.       
  190.       <!-- LONG CONTENT (the section most likely to require scrolling) -->
  191.       <div id="errorLongContent">
  192.       
  193.         <!-- Short Description -->
  194.         <div id="errorShortDesc">
  195.           <p id="errorShortDescText" />
  196.         </div>
  197.  
  198.         <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
  199.         <div id="errorLongDesc" />
  200.  
  201.       </div>
  202.  
  203.       <!-- Retry Button -->
  204.       <xul:button xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  205.                   id="errorTryAgain" label="&retry.label;" oncommand="retryThis();" />
  206.  
  207.     </div>
  208.  
  209.     <!--
  210.     - Note: It is important to run the script this way, instead of using
  211.     - an onload handler. This is because error pages are loaded as
  212.     - LOAD_BACKGROUND, which means that onload handlers will not be executed.
  213.     -->
  214.     <script type="application/x-javascript">initPage();</script>
  215.  
  216.   </body>
  217. </html>
  218.